﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cesave.Domain.PermisosModule.Entities;
using System.Data.Objects;
using Cesave.Infrastructure.Data.Core;

namespace Cesave.Infrastructure.Data.PermisosModule.Mock
{
	public partial class PermisosModuleFakeContext
	{
		static List<Distrito> _distritos;

		public Guid Distrito149Guid = Guid.NewGuid();
		public Guid Distrito148Guid = Guid.NewGuid();
		public Guid Distrito999Guid = Guid.NewGuid();

		private void InitiateInnerDistritosCollection()
		{
			if (_distritos == null)
				_distritos = new List<Distrito>()
				{
					new Distrito
					{
						DistritoId = 11,
						DistritoGuid = Distrito149Guid,
						EstadoId = 26,
						EstadoGuid = new Guid("B13F5C3F-AA42-4943-A8E9-49BA546EE5D1"),
						Nombre = "Distrito de Navojoa",
						Numero = "149",
						Status = true,
					},
					new Distrito
					{
						DistritoId = 7,
						DistritoGuid = Distrito148Guid,
						EstadoGuid = new Guid("B13F5C3F-AA42-4943-A8E9-49BA546EE5D1"),
						EstadoId = 26,
						Nombre = "Distrito de Huatabampo",
						Numero = "148",
						Status = true,
					},
					new Distrito
					{
						DistritoId = 4,
						DistritoGuid = Distrito999Guid,
						EstadoGuid = new Guid("409D515D-E426-4401-997A-013866E9F12C"),
						EstadoId = 24,
						Nombre = "Distrito desactivado",
						Numero = "999",
						Status = false,
					},
				};
		}

		private IObjectSet<Distrito> CreateDistritosObjectSet()
		{
			return _distritos.ToInMemoryObjectSet();
		}

		private void InitiateFakeDistritos()
		{
			DistritosGet = () => CreateDistritosObjectSet();
			CreateObjectSet<Distrito>(() => CreateDistritosObjectSet());
		}
	}
}
